﻿@namespace BootstrapBlazor.Components
@typeparam TType
@inherits FilterBase

@if (IsHeaderRow)
{
    <div class="@FilterRowClassString">
        @if (typeof(TType).IsNumber())
        {
            <BootstrapInputNumber @bind-Value="@Value1" ShowLabel="false" OnValueChanged="_ => OnFilterValueChanged()" Step="@Step"></BootstrapInputNumber>
        }
        else
        {
            <BootstrapInput @bind-Value="@Value1" ShowLabel="false" OnValueChanged="_ => OnFilterValueChanged()"></BootstrapInput>
        }
        <FilterButton Items="Items" @bind-Value="Action1" OnSelectedItemChanged="_ => OnFilterValueChanged()" OnClearFilter="OnClearFilter" />
    </div>
}
else
{
    <Select Items="@Items" @bind-Value="@Action1"></Select>

    @if (typeof(TType).IsNumber())
    {
        <BootstrapInputNumber @bind-Value="@Value1" ShowLabel="false" Step="@Step"></BootstrapInputNumber>
    }
    else
    {
        <BootstrapInput @bind-Value="@Value1" ShowLabel="false"></BootstrapInput>
    }

    @if (Count > 0)
    {
        <FilterLogicItem @bind-Logic="Logic"></FilterLogicItem>

        <Select Items="@Items" @bind-Value="@Action2"></Select>

        @if (typeof(TType).IsNumber())
        {
            <BootstrapInputNumber @bind-Value="@Value2" ShowLabel="false" Step="@Step"></BootstrapInputNumber>
        }
        else
        {
            <BootstrapInput @bind-Value="@Value2" ShowLabel="false"></BootstrapInput>
        }
    }
}
